#!/bin/sh

# getchar.sh - 輸入1個字的範例

echo "Hit any key!"

#enable raw:輸入字元不用加enter, disable echo: 不會顯示輸入的字元 
stty raw -echo
#read 1 bytes from stdin
char=`dd bs=1 count=1 2>/dev/null`
stty -raw echo

echo "Key pressed: '$char'"
